package com.tensquare.friend.client;

import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Author:zimmor
 * @Date: 2021/3/16 14:13
 * @Description 调用user微服务的客户端
 * @version: 1.0.0
 */
@FeignClient(name = "tensquare-user", fallback = FriendHystrix.class)
public interface UserClient {
    //来映射调用的微服务(关注某个用户)
    @RequestMapping(method = RequestMethod.PUT, value = "/user/follow/{friendid}")
    public Result attention(@PathVariable(value="friendid") String friendid);
    @RequestMapping(method = RequestMethod.DELETE, value = "/user/follow/{friendid}")
    public Result cancleAttention(@PathVariable(value="friendid") String friendid);
}
